package lesson17.car;

public class Car {
	protected String model;
	private int maxSpeed = 230;
	protected int currentSpeed;
	protected int currentGear;
	protected int numberOfDoors;
	private String idNumber;
	protected boolean isSportCar;
	protected Person owner;
	
	protected String type = "Just a car";
	
	Car(int maxSpeed)
	{
		if(maxSpeed > 10)
			this.maxSpeed = maxSpeed;
	}
	
	protected void changeOwner(Person newPerson)
	{
		this.owner = newPerson;
	}
	protected void startEngine()
	{
		System.out.println("Brum Brum");
	}
	protected void changeGear(int gear)
	{
		this.currentGear = gear;
	}
	
	protected void accelerate(double speed)
	{
		if(this.currentSpeed + speed > this.maxSpeed)
			currentSpeed = maxSpeed;
		else
			currentSpeed += speed;
		
		System.out.println("Now driving with " + currentSpeed + "km/h");
	}
	
	protected int getMaxSpeed()
	{
		return this.maxSpeed;
	}
	
	/*protected void setMaxSpeed(int maxSpeed)
	{
		this.maxSpeed = maxSpeed;
	}*/
	
	
	
}
